<!--顶部-->
<block name="include"><include file="Index:top" /></block>
<!--顶部-->
<!--==============================
              header
=================================-->
<!--=====================
          Content
======================-->
<script type="text/javascript">
    var CONTROLLER="__CONTROLLER__";
    $(function(){
        //获取select中的ID

        //首先判断上来自动选择的城市
        $('select[name=city1]').change(function(){
            //取出当前对象
            var obj = $(this);
            var pid = obj.val();
        });

        $('select[name=city2]').change(function(){
            //获取省份的id
            var pid=document.getElementById("city1").value;

            var obj = $(this);
            //获取城市级别
            var level = obj.val();
            $.post("./index.php?g=Wap&m=Agentpay&a=ajax",{pid : pid, level : level},function(data){
                if(data!=null){
                    var option = '';
                    $.each(data, function(i, k){

                        option += '<option value="' + k.id + '">' + k.cname + '</option>';
                    })

                   $("#level2").html(option);

                    //获得二级区域的id
                    window.cid=obj.next().html(option).val();
                }else{

                    var option = '';

                    option += '<option value="">' +"--" + '</option>';

                   $("#level2").html(option);
//
                }

            },'json');

        });
        //点击下一步
        $("#next").click(function(){
            var id=document.getElementById("level2").value;
            var token=document.getElementById("token").value;
            var openid=document.getElementById("openid").value;
            if(!id){
                alert('请选择城市');
//                return false;
                window.location.href=CONTROLLER+"/info?id="+id+"&token="+token+"&openid="+openid+"";
            }else{
                window.location.href=CONTROLLER+"/info?id="+id+"&token="+token+"&openid="+openid+"";
                // header("./index.php?m=Index&a=agent");
                // alert(id);
            }
        })

    });

</script>
<style type="text/css">
    .container{

    }
    .select{
        border: solid black 1px;
        background: beige;
    }
    .form-group{
        opacity: 0.7;

    }
</style>
<p class="text-center" style="color:red">等你约(北京)科技有限公司</p>
<p class="text-center">
    <small style="">请选择您要代理的城市</small>
</p>
  <div class="container">
  <!--<div class="row text-center"> <img src="{pigcms:$staticPath}/tpl/static/agentpay/Public/images/11.png" alt=""></div>-->



      <div class="form-group">
          <select data-toggle="select" id="city1"  class="form-control select select-default select-hg" style="height:40px;">

                  <option value="" disabled="false" selected="selected">请选择省份</option>
                  <volist name="data" id="v">
                    <option value="{pigcms:$v.id}">{pigcms:$v.cname}</option>
                  </volist>

          </select>
      </div>
      <br/>
      <div class="form-group">
          <select data-toggle="select" name="city2" class="form-control select select-default select-hg" style="height:40px;">

                  <option value="" disabled="false" selected="selected">请选择城市级别</option>
                  <option value="1">一线城市</option>
                  <option value="2">二线城市</option>
                  <option value="3">三线城市</option>
                  <option value="4">四线城市</option>
                  <option value="5">五线城市</option>

          </select>
      </div>
      <br/>



      <div class="form-group">
          <select data-toggle="select" name="city3" id="level2" class="form-control select select-default select-hg" style="height:40px;">
              <option value="" >请选择城市</option>
          </select>
      </div>





              <input type="hidden" id="token" value="{pigcms:$token}"/>
              <input type="hidden" id="openid" value="{pigcms:$openid}"/>

              <br/><br/>
      <div class="row">
          <div class="col-md-12">
              <p>
                  <button type="button" id="next" class="btn btn-primary btn-lg btn-block">下一步</button>
              </p>
          </div>
      </div>



  </div>

</section>
<!--<footer id="footer">-->
    <!--<div class="container">-->
        <!--<a href="#">电话：400-855-8893</a><br>-->
        <!--<a href="#">传真：010-56290463 </a><br>-->
        <!--<a href="#">地址：北京市海淀区知春路罗庄西里碧兴园2号楼2501</a><br>-->
        <!--<a href="#">京ICP备14001705号-3</a>-->
    <!--</div>-->
<!--</footer>-->
<!--==============================
              footer
=================================-->

<block name="include"><include file="Index:foot"/></block>